package com.example.demo.util;

import com.example.demo.exception.BusyException;

import java.util.function.Supplier;

public final class AssertUtil {

    public AssertUtil() {
    }

    public  static  void notNull(Object a, String message) throws BusyException{
        assertThat(a != null, () -> new BusyException(message));
    }
    public static <X extends RuntimeException> void assertThat(boolean express, Supplier<? extends X> supplier) throws X {
        if (!express) {
           throw supplier.get();
        }
    }
}
